package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Complaints {
    private int comId;
    private String comType;
    private Timestamp comTime;
    private String comDegree;
    private String comState;
    private String comDesc;
    private String comDescription;
    private Customer customerByCustomerId;
    private Long comChager;
    private Employee employee;

    @ManyToOne(cascade={CascadeType.MERGE,CascadeType.REFRESH},optional=false)//可选属性optional=false,表示author不能为空。删除文章，不影响用户
    @JoinColumn(name = "COM_CHAGER",insertable = false,updatable = false)//设置在article表中的关联字段(外键)
    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }
    @Basic
    @Column(name = "COM_CHAGER")
    public Long getComChager() {
        return comChager;
    }

    public void setComChager(Long comChager) {
        this.comChager = comChager;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }
    @Id
    @Column(name = "com_id")
    @GeneratedValue(generator = "seq",strategy = GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name = "seq",sequenceName = "crm",
            initialValue = 1,allocationSize = 1)
    public int getComId() {
        return comId;
    }

    public void setComId(int comId) {
        this.comId = comId;
    }

    @Basic
    @Column(name = "com_type")
    public String getComType() {
        return comType;
    }

    public void setComType(String comType) {
        this.comType = comType;
    }


    @Column(name = "com_time")
    public Timestamp getComTime() {
        return comTime;
    }

    public void setComTime(Timestamp comTime) {
        this.comTime = comTime;
    }

    @Basic
    @Column(name = "com_degree")
    public String getComDegree() {
        return comDegree;
    }

    public void setComDegree(String comDegree) {
        this.comDegree = comDegree;
    }

    @Basic
    @Column(name = "com_state")
    public String getComState() {
        return comState;
    }

    public void setComState(String comState) {
        this.comState = comState;
    }

    @Basic
    @Column(name = "com_desc")
    public String getComDesc() {
        return comDesc;
    }

    public void setComDesc(String comDesc) {
        this.comDesc = comDesc;
    }

    @Basic
    @Column(name = "com_description")
    public String getComDescription() {
        return comDescription;
    }

    public void setComDescription(String comDescription) {
        this.comDescription = comDescription;
    }


}
